package com.itheima.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//添加为spring配置类
@Configuration
public class MpConfig {

    //添加第三方的bean
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor (){
        //创建mybatis-plus拦截器
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //添加分页相关功能的拦截器
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}
